var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/businessComponent/imp/cpts/ShowCheckRuleInfo.tsx
var ShowCheckRuleInfo_exports = {};
__export(ShowCheckRuleInfo_exports, {
  ShowCheckRuleInfo: () => ShowCheckRuleInfo
});
module.exports = __toCommonJS(ShowCheckRuleInfo_exports);
var import_icons = require("@ant-design/icons");
var import_functionalComponent = require("../../../functionalComponent");
var import_util = require("../../../util");
var columns = [
  {
    dataIndex: "retFlag",
    title: "校验结果",
    width: 100,
    render: ({ value }) => /* @__PURE__ */ React.createElement("span", null, value === "forbid" && /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(import_icons.CloseCircleFilled, { style: { color: "red" } }), " 不通过"), value === "prompt" && /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(import_icons.ExclamationCircleFilled, { style: { color: "orange" } }), " 有风险通过"), value === "ignore" && /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(import_icons.CheckCircleFilled, { style: { color: "green" } }), " 通过"))
  },
  { dataIndex: "ruleName", title: "业务规则名称", width: 150 },
  { dataIndex: "ruleContent", title: "触发规则", tooltip: true, flex: 1 },
  {
    dataIndex: "retTip",
    title: "提示信息",
    tooltip: "render",
    flex: 1,
    render: ({ value, row }) => {
      var _a;
      if (row.retFlag === "forbid") {
        const relateBusinessContent = (_a = row == null ? void 0 : row.retExtUrls) == null ? void 0 : _a.map((item, index) => {
          return /* @__PURE__ */ React.createElement(
            "a",
            {
              key: index,
              style: { marginRight: 10 },
              onClick: () => {
                import_util.iup.open(item.url);
              }
            },
            item.name,
            " ",
            index < row.retExtUrls.length - 1 && ";"
          );
        });
        return /* @__PURE__ */ React.createElement("div", null, value, " ", /* @__PURE__ */ React.createElement("br", null), relateBusinessContent);
      } else if (row.retFlag === "prompt") {
        return value;
      } else {
        return;
      }
    }
  }
];
function ShowCheckRuleInfo({ dataSource }) {
  const [getRef] = (0, import_util.useRefs)();
  return /* @__PURE__ */ React.createElement(import_util.Layout, { direction: "column", autoFit: true, style: { padding: 5 } }, /* @__PURE__ */ React.createElement(import_util.Layout.Flex, { style: { border: import_util.cssVar.border, borderRadius: 4 } }, /* @__PURE__ */ React.createElement(import_functionalComponent.Table, { columns, ref: getRef("table"), dataSource, rowHeight: 50 })));
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ShowCheckRuleInfo
});
